package icu.cocoon.system.entity;


import com.baomidou.mybatisplus.annotation.TableName;
import icu.cocoon.dao.base.BaseEntity;
import icu.cocoon.util.ITree;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;


@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("sys_org")
@ApiModel(value = "Org对象", description = "")
public class Org extends BaseEntity implements ITree {

  @NotNull(message = "parentId不允许为空")
  @ApiModelProperty("父ID")
  private Long parentId;

  @NotBlank(message = "name不允许为空")
  @ApiModelProperty("名称")
  private String name;

  @Override
  public String getLabel() {
    return this.name;
  }
}
